package com.tiku.controller;

import com.tiku.common.ResultJson;
import com.tiku.controller.DTO.ErrorRemoveDTO;
import com.tiku.service.UserErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 小马不会跑
 * @create 2024-10-01 1:09
 */
@RestController
@RequestMapping("/errors")
@CrossOrigin("*")
public class UserErrorController {
    @Autowired
    private UserErrorService userErrorService;

    @GetMapping("/users/error/{specification}")
    public ResultJson getUserError(@PathVariable("specification") String specification){
        return userErrorService.getUserError(specification);
    }

    @GetMapping("/users/errors/{specification}/{menuId}")
    public ResultJson getErrors(@PathVariable("specification") String specification,@PathVariable("menuId") String menuId){
        return userErrorService.getErrorList(specification,menuId);
    }

    @GetMapping("/errorRemove/{queueId}/{chapterId}")
    public ResultJson errorRemove(@PathVariable("queueId") String queueId,@PathVariable("chapterId")String chapterId) {
        return userErrorService.errorRemove(queueId,chapterId);
    }
}
